﻿using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace Apply
{
    class StringArrayConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            Contract.Requires(value is string[]);
            Contract.Requires(parameter is string);
            string[] stringCollection = (string[])value;
            string separator = (string)parameter;
            return string.Join(separator, stringCollection);

        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
